package com.mmall.seckill.service;

import com.mmall.seckill.common.Result;
import com.mmall.seckill.domain.OrderInfo;
import com.mmall.seckill.domain.SeckillUser;
import com.mmall.seckill.vo.GoodsVo;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by megan on 2018/6/19.
 * 订单
 */
public interface OrderService {

    /**
     * 订单详情
     * @param user
     * @param orderId
     * @return
     */
    Result getOrderDetail(SeckillUser user, Long orderId);

    OrderInfo getOrderById(Long orderId);

    /**
     * 下订单
     * @param user
     * @param goods
     * @return
     */
    @Transactional
    OrderInfo placeTheOrder(SeckillUser user, GoodsVo goods);

    /**
     * 减库存下订单，插入秒杀订单表
     * @param user
     * @param goods
     * @return
     */
    OrderInfo miaoshaDb(SeckillUser user, GoodsVo goods);
}
